import { Injectable } from "@angular/core";
import { Http } from "@angular/http";
//import {Storage, LocalStorage} from 'ionic-angular';
import { Observable } from "rxjs/Observable";

import { HttpService } from "./HttpService";
import { StorageService } from "./StorageService";

@Injectable()
export class StyleService {
  constructor(
    private http: Http,
    private httpService: HttpService,
    private storageService: StorageService
  ) {}

  /**
   *  得到首页循环广告 及 弹出广告
   */
  getAdlist(param) {
    var url = "getAdAPI";
    return this.httpService.httpGetNoAuth(url, param);
  }

  /**
   * 取款式列表
   */
  getStyleList() {
    var url = "getTabBarNailsStyleAPI";
    return this.httpService.httpGetNoAuth(url);
  }
  /**
     * 取某个款式的所有图样
     * @param param 
     *  page_size	可选	int	获取数据长度 默认8
        page_pos	可选	int	获取数据起始点 默认0
        nail_type	可选	int	需要获取哪一款美甲款式 默认是1
     */
  getStyleByid(param) {
    var url = "getTabBarNailsAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /** 获取美甲详情 */
  getNailDetailsAPI(param) {
    var url = "getNailDetailsAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /** 获取服务详情接口 */
  getBuyServiceAPI(param) {
    var url = "getBuyServiceAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /** 获取款式风格 */
  getSearchConditionAPI(param) {
    var url = "getSearchConditionAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /** 美图美款评论 */
  publishCommentAPI(param) {
    var url = "publishCommentAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /** 美图美款关注 */
  focusAPI(param) {
    var url = "focusAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /** 美图美款收藏 */
  collectionAPI(param) {
    var url = "collectionAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /** 美图美款点赞 */
  zankNailAPI(param) {
    var url = "zankNailAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }

  /** 美图美款搜索*/
  searchAPI(param) {
    var url = "searchAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }

  /*将商品添加至当前用户的购物车中*/
  addToCartAPI(param) {
    var url = "addToCartAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /**确认订单  立即购买服务*/
  submitServiceOrderAPI(param) {
    var url = "submitServiceOrderAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }
  /**确认订单  立即购买服务*/
  shopkeeperBuyNailAPI(param) {
    var url = "shopkeeperBuyNailAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }

  /*使用优惠券支付 店铺保证金*/
  payShopBondAPI(param) {
    var url = "payShopBondAPI";
    return this.httpService.httpPostNoAuth(url, param);
  }

  /*通过服务的 id 得到当前服务的 评论*/
  getMoreRemarksAPI(param) {
    var url = "getMoreRemarksAPI";
    return this.httpService.httpGetNoAuth(url, param);
  }
  userPayListAPI(param) {
    var url = "userPayListAPI";
    return this.httpService.httpGetNoAuth(url, param);
  }

}
